package com.mingdong.first.celue.duck;

import com.mingdong.first.celue.flyBehavior.FlyBehavior;
import com.mingdong.first.celue.quackBehavior.QuackBehavior;

public abstract class Duck {

	FlyBehavior flyBehavior;
	QuackBehavior quackBehavior;
	
	public void quack(){
		
		quackBehavior.quack();		
	}
	public void fly(){
		flyBehavior.fly();
	}
	
	public abstract void display();
	
	public void setFlyBehavior(FlyBehavior flyBehavior) {
		this.flyBehavior = flyBehavior;
	}
	public void setQuackBehavior(QuackBehavior quackBehavior) {
		this.quackBehavior = quackBehavior;
	}
	
	public void swim(){
		System.out.println("swim");
	}
	
}
